// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
//css
import './assets/css/reset.css'
//iview
import iView from 'iview';
import 'iview/dist/styles/iview.css';
//axios
import axios from 'axios'
//i18n
import VueI18n from 'vue-i18n'
//store
import store from "./store/index.js"; //引入存储入口"
//引入utils
import utils from './assets/js/utils'
//引入iconfont
import './assets/iconfont/iconfont.css'
//引入视频播放器
import VideoPlayer from 'vue-video-player'

// 引入mockjs
require('./mock/mock.js');
//引入视频播放器
require('video.js/dist/video-js.css')
require('vue-video-player/src/custom-theme.css')
//引入动画css
require('animate.css/animate.min.css');

Vue.use(router);
Vue.use(iView);
Vue.use(VueI18n);
Vue.use(VideoPlayer)

//路由跳转顶部loadingbar
router.beforeEach((to, from, next) => {
  iView.LoadingBar.start();
  next();
});

router.afterEach(route => {
  iView.LoadingBar.finish();
});

const i18n = new VueI18n({
  locale: window.localStorage.getItem('language') === null ? 'en' : window.localStorage.getItem('language'), // 语言标识
  messages: {
    'zh': require('./assets/lang/zh'),
    'en': require('./assets/lang/en')
  }
})

Vue.prototype.$axios = axios;
Vue.prototype.$utils = utils;

Vue.config.productionTip = false

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  i18n,
  components: { App },
  template: '<App/>'
})

